<link href="/res/js/wysiwyg/jquery.wysiwyg.css" media="screen" rel="Stylesheet" type="text/css" />
<script type="text/javascript" src="/res/js/wysiwyg/jquery.wysiwyg.js"></script>
{literal}<script>
$(function()
{
    $('#wysiwyg').wysiwyg();
});
</script>{/literal}

<div class="add_category"><a href="/admin/category/view/{$photo.category_id}/">Назад в раздел</a></div>

<div id="content">
		<div id="inner">
			<img src="{$photo.image}"/>
            <form action="/admin/photo/go/" method="post" enctype="multipart/form-data">
            <input type="hidden" name="type" value="edit" />
            <input type="hidden" name="id" value="{$photo.id}" />
                <div id="content">
                        <div id="inner">
                        <table cellspacing="0" cellpadding="4">
                            <tbody class="edit">
                                <tr>
                                    <th width="200px">Категория</th>
                                    <td>
                                    <select name="category">
                                        {foreach from=$category item=doc}
                                            <option value="{$doc.id}" {if $photo.category_id == $doc.id}selected{/if}>{$doc.name}</option>
                                            {foreach from=$doc.parent item=parent}
                                            <option value="{$parent.id}" {if $photo.category_id == $parent.id}selected{/if}>{$parent.name}</option>
                                            {/foreach}  
                                        {/foreach}
                                    </select>

                                    </td>
                                </tr>
                                <tr>
                                    <th width="200px">Название фото</th>
                                    <td><input type="text" name="name" value="{$photo.name}"/></td>
                                </tr>
                                <tr>
                                    <th width="200px">Описание</th>
                                    <td><textarea name="description" id="wysiwyg">{$photo.description}</textarea></td>
                                </tr>
                                <tr>
                                    <th width="200px">{if $photo.image}Обновить{else}Добавить изображение{/if}</th>
                                    <td><input type="file" name="userfile" /></td>
                                </tr>
                            </tbody>
                        </table>
                        </div>

                </div>
                <br />
                <input type="submit" value="Сохранить" />
            </form>
		</div>
	</div>